# -*- coding: utf-8 -*-
#----------------------------------------------------------------------------#
# testHanChar.py
# Lars Yencken <lars.yencken@gmail.com>
# vim: ts=4 sw=4 sts=4 et tw=78:
# Wed Mar  7 18:35:52 2007
#
#----------------------------------------------------------------------------# 

import unittest
from hanChar import *

#----------------------------------------------------------------------------#

def suite():
    testSuite = unittest.TestSuite((
            unittest.makeSuite(HanCharTestCase)
        ))
    return testSuite

#----------------------------------------------------------------------------#

class HanCharTestCase(unittest.TestCase):
    """ This class tests the HanChar class. 
    """
    def setUp(self):
        pass

    def testCommonChinese(self):
        """ Tests the fetching of common Chinese characters.
        """
        chars = getChCommonChar()
        assert len(chars) > 1000
        for char in chars:
            self.assertEqual(len(char), 1)
        pass

    def testCommonJapanese(self):
        """ Tests the fetching of common Japanese characters.
        """
        chars = getJpCommonChar()
        assert len(chars) > 1000
        for char in chars:
            self.assertEqual(len(char), 1)
        pass
    
    def tearDown(self):
        pass

#----------------------------------------------------------------------------#

if __name__ == "__main__":
    unittest.TextTestRunner(verbosity=1).run(suite())

#----------------------------------------------------------------------------#

# vim: ts=4 sw=4 sts=4 et tw=78:

